import 'package:boss/textStyle/text_style.dart';
import 'package:boss/ui/page/commodity/bindingCommodity/provider/binding_commodity_provider.dart';
import 'package:boss/ui/widget/label_button.dart';
import 'package:hi_common/hi_common.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';

class UnBoundRow extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Container(
      padding: EdgeInsets.symmetric(
        horizontal: 30.w,
        vertical: 15.w,
      ),
      child: Column(
        children: <Widget>[
          Text(
            '已关联菜品可调整堂食菜品进行统一修改，或者编辑外卖商品修改不同售价',
            style: TextStyleConstant().normal_3_28,
          ),
          Container(
            margin: EdgeInsets.only(
              top: 15.w,
            ),
            child: Row(
              mainAxisAlignment: MainAxisAlignment.spaceBetween,
              children: <Widget>[
                Consumer<BindingCommodityProvider>(
                  builder: (context, provider, child) => Text('未关联的菜品（${provider.data.commodityList.length}）'),
                ),
                LabelButton(
                  title: '一键关联',
                  onTap: () {
                    Provider.of<BindingCommodityProvider>(context, listen: false).bindingAll();
                  },
                ),
              ],
            ),
          ),
        ],
      ),
    );
  }
}
